package com.redepronik.negosys.invfac.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * The persistent class for the kardex database table.
 * 
 */
@Entity
@Table(schema = "invfac", name = "kardex")
@NamedQuery(name = "Kardex.findAll", query = "SELECT k FROM Kardex k")
public class Kardex implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(allocationSize = 1, name = "KARDEX_KARDEXID_GENERATOR", sequenceName = "INVFAC.KARDEX_KARDEXID_SEQ")
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "KARDEX_KARDEXID_GENERATOR")
	@Column(unique = true, nullable = false)
	private Long kardexid;

	@Column(nullable = false)
	private Integer cantidad;

	@Column(nullable = false)
	private Timestamp fecha;

	@Column(nullable = false, length = 2147483647)
	private String nota;

	@Column(nullable = false, precision = 20, scale = 10)
	private BigDecimal precio;

	@Column(nullable = false)
	private Boolean activo;

	// bi-directional many-to-one association to Bodega
	@ManyToOne
	@JoinColumn(name = "bodegaid", nullable = false)
	private Bodega bodega;

	// bi-directional many-to-one association to Estadokardex
	@ManyToOne
	@JoinColumn(name = "estadokardexid", nullable = false)
	private Estadokardex estadokardex;

	// bi-directional many-to-one association to Producto
	@ManyToOne
	@JoinColumn(name = "productoid", nullable = false)
	private Producto producto;

	public Kardex() {
	}

	public Boolean getActivo() {
		return activo;
	}

	public Bodega getBodega() {
		return this.bodega;
	}

	public Integer getCantidad() {
		return this.cantidad;
	}

	public Estadokardex getEstadokardex() {
		return this.estadokardex;
	}

	public Timestamp getFecha() {
		return this.fecha;
	}

	public Long getKardexid() {
		return this.kardexid;
	}

	public String getNota() {
		return this.nota;
	}

	public BigDecimal getPrecio() {
		return this.precio;
	}

	public Producto getProducto() {
		return this.producto;
	}

	public void setActivo(Boolean activo) {
		this.activo = activo;
	}

	public void setBodega(Bodega bodega) {
		this.bodega = bodega;
	}

	public void setCantidad(Integer cantidad) {
		this.cantidad = cantidad;
	}

	public void setEstadokardex(Estadokardex estadokardex) {
		this.estadokardex = estadokardex;
	}

	public void setFecha(Timestamp fecha) {
		this.fecha = fecha;
	}

	public void setKardexid(Long kardexid) {
		this.kardexid = kardexid;
	}

	public void setNota(String nota) {
		this.nota = nota;
	}

	public void setPrecio(BigDecimal precio) {
		this.precio = precio;
	}

	public void setProducto(Producto producto) {
		this.producto = producto;
	}

}